using System.Web; 
using System.Text.RegularExpressions; 
using Microsoft.VisualBasic;
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Drawing;
using System.Diagnostics;
using System.Windows.Forms;
namespace IWeb_Core_Connector
{
    public class IWebVersion  
    { 
        public static IWebVersion_Info GetVersion() 
        {
            IWeb_Core_Connector.IWebservice.WebService IWeb = new IWeb_Core_Connector.IWebservice.WebService(); 
            IWeb.Url = IWeb_Core_Connector.IWeb_Form.TransDefaultFormIWeb_Form.WebserviceURL; 
            IWeb.IWebAuthendicationHeaderValue = IWebAuthendication.AttachCredentials(); 
            IWebVersion_Info IWebVersion_Info = new IWebVersion_Info(); 
            IWebVersion_Info.VersionName = IWeb.GetVersion(); 
            IWebVersion_Info.VersionNumber = int.Parse( Regex.Replace( IWebVersion_Info.VersionName, @"\D", "" ) ); 
            return IWebVersion_Info; 
        } 
        
        public static bool CheckVersion( int VersionToCheck ) 
        {
            IWeb_Core_Connector.IWebservice.WebService IWeb = new IWeb_Core_Connector.IWebservice.WebService(); 
            IWeb.Url = IWeb_Core_Connector.IWeb_Form.TransDefaultFormIWeb_Form.WebserviceURL; 
            IWeb.IWebAuthendicationHeaderValue = IWebAuthendication.AttachCredentials(); 
            bool boolReturnValue = false; 
            if ( ( VersionToCheck > int.Parse( Regex.Replace( IWeb.GetVersion(), @"\D", "" ) ) ) ) 
            { 
                boolReturnValue = false; 
            } 
            else 
            { 
                boolReturnValue = true; 
            } 
            return boolReturnValue; 
        } 
        
    } 
    
    
} 
